import request from '@/utils/request'

const api_name = '/eduservice/chapter'

export default {
    getNestedTreeList(courseId) {
        return request({
            url: `${api_name}/${courseId}`,
            method: 'get'
        })
    },
    addChapter(chapter) {
        return request({
            url: `${api_name}`,
            method: 'post',
            data: chapter
        })
    },
    getChapterId(chapterId) {
        return request({
            url: `${api_name}/chapterInfo/${chapterId}`,
            method: 'get'
        })    
    },
    updateChapter(chapter){
        return request({
            url: `${api_name}/updateChapter/${chapter.id}`,
            method: 'post',
            data: chapter
        })   
    },
    deleteChapter(chapterId){
        return request({
            url: `${api_name}/${chapterId}`,
            method: 'delete'
        })   
    }

}